package com.framework.seedkit.base;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;

import com.framework.seedkit.app.AppActivityManager;

import butterknife.ButterKnife;

public abstract class BaseFragmentActivity extends FragmentActivity {
	public String tag;
	protected Context mContext = null;
	protected LayoutInflater mInflater = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mContext = this;
		tag = this.getClass().getSimpleName();
		AppActivityManager.getAppManager().addActivity(this);
		
		if (getLayoutId() != 0) {
			setContentView(getLayoutId());
		}
		ButterKnife.bind(this);
		mInflater = getLayoutInflater();
	}
	
	protected int getLayoutId() {
		return 0;
	}

	@Override
	protected void onResume() {
		super.onResume();

	}

	@Override
	protected void onPause() {
		super.onPause();

	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		
		AppActivityManager.getAppManager().finishActivity(this);
	}
}
